#pragma once
#ifndef _SHOW_PUB_H_
#define _SHOW_PUB_H_

#include"common_include.h"
#include"frame.h"
#include"map.h"

namespace fast_lio{

class ShowPub{
public:
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
    typedef std::shared_ptr<ShowPub> Ptr;

    ShowPub();

    ShowPub(ros::NodeHandle& nh){
        nh_ = nh;
        pc_map_pub_ = nh_.advertise<sensor_msgs::PointCloud2>("fast_lio/map",10);
        pc_full_pub_ = nh_.advertise<sensor_msgs::PointCloud2>("fast_lio/pc_full",10);
        odom_pub_ = nh.advertise<nav_msgs::Odometry>("fast_lio/odom",10);
        imu_integ_odom_pub_ = nh.advertise<nav_msgs::Odometry>("fast_lio/imu_integ_odom_pub",10);
    }

    void pubMap(pcl::PointCloud<PointType>::Ptr p_map);  //这里是指针，只是访问内存，后面有后端优化的话，需要考虑多线程问题

    void pubFull(pcl::PointCloud<PointType>::Ptr p_map);

    void pubOdom(double* var);

    void pubImuIntegOdom(nav_msgs::Odometry odom);

private:
    ros::NodeHandle nh_;

    ros::Publisher pc_map_pub_,odom_pub_,pc_full_pub_,
                                imu_integ_odom_pub_;

};

}
#endif  
